package com.ruoyi.purchase.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.purchase.domain.Brand;
import com.ruoyi.purchase.service.BrandService;
import com.ruoyi.purchase.mapper.BrandMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand>
    implements BrandService{
    @Autowired
    private BrandMapper brandMapper;

    @Override
    public List<Brand> queryList(Brand brand) {
//        QueryWrapper<Brand> queryWrapper = Wrappers.query();
//        if (StringUtils.isNotEmpty(brand.getBrandName()))
//        {
//            queryWrapper.eq("brand_name", brand.getBrandName());
//        }
//        if (StringUtils.isNotNull(brand.getStatus()))
//        {
//            queryWrapper.eq("status", brand.getStatus());
//        }
//
//        return brandMapper.selectList(queryWrapper);
        return  brandMapper.findAllBrand(brand);
    }
}




